package org.jeecg.enums.car;

/**
 * 车辆状态
 */
public enum CarStatusEnum {
    SYNC_STATUS_NORMAL(0, "启用"),
    SYNC_STATUS_STOP(1, "停用"),
    ;


    private Integer code;
    private String desc;

    CarStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }


    public static String getDesc(Integer value) {
        if (value == null) return "";
        CarStatusEnum[] enums = values();
        for (CarStatusEnum typeEnum : enums) {
            if (value.intValue() == typeEnum.getCode().intValue()) {
                return typeEnum.desc;
            }
        }
        return "";
    }

    public static Integer getValue(String desc) {
        CarStatusEnum[] enums = values();
        for (CarStatusEnum typeEnum : enums) {
            if (typeEnum.getDesc().equals(desc)) {
                return typeEnum.code;
            }
        }
        return null;
    }



}
